
const Koa = require('koa');
const router = require('./router/router')
const bookRouter = require('./router/bookRouter')
const ordersRouter = require('./router/ordersRouter')
const orderRouter = require('./router/orderRouter')

const app = new Koa();

// 注册路由
app.use(orderRouter.routes() , orderRouter.allowedMethods())
app.use(ordersRouter.routes() , ordersRouter.allowedMethods())
app.use(bookRouter.routes() , bookRouter.allowedMethods())
app.use(router.routes(), router.allowedMethods())

app.listen(8081 , () => {
    console.log('服务端启动在 localhost:8081')
});